X

Node.js

Adding Time to an Express Session

November 19, 2022

/*

Adding Time to a Session


*/

When you create an express session, you get to set the expiration or maxage properties for the session cookie. You can access these properties within the session object. For this example, I'm going to be adding 5 minutes to the maxage property of the cookie when the user hits the route timeextend. You can read all about the options for a cookie here.

Adding time to an express session

About the Author

Christopher Howard

Chris is a Javascript developer with a minor in UI design. He values programming in vanilla code. Fill out the form below to contact him.